package gob.inei.enaho.context;

import gob.inei.enaho.model.database.EnahoOpenHelper;
import gob.inei.enaho.model.service.ConglomeradoService;
import gob.inei.enaho.model.service.DataXmlMarcoService;
import gob.inei.enaho.model.service.DepartamentoService;
import gob.inei.enaho.model.service.DistritoService;
import gob.inei.enaho.model.service.Ena01Cap100AService;
import gob.inei.enaho.model.service.Ena01Cap100Service;
import gob.inei.enaho.model.service.MiembroHogarEna01Cap200Service;
import gob.inei.enaho.model.service.Ena01ObservacionesService;
import gob.inei.enaho.model.service.Ena01OtrosHogarService;
import gob.inei.enaho.model.service.EncuestadorService;
import gob.inei.enaho.model.service.HogarService;
import gob.inei.enaho.model.service.OdeiService;
import gob.inei.enaho.model.service.PeriodoService;
import gob.inei.enaho.model.service.PersonaPanelService;
import gob.inei.enaho.model.service.PersonalService;
import gob.inei.enaho.model.service.ProvinciaService;
import gob.inei.enaho.model.service.VisitaEncuestadorService;
import gob.inei.enaho.model.service.VisitaSupervisorService;
import gob.inei.enaho.model.service.ViviendaMarcoService;
import gob.inei.enaho.model.service.ViviendaService;


public class ModelContext {

	private EnahoOpenHelper openHelper;
	
	private final DataXmlMarcoService dataXmlMarcoService = new DataXmlMarcoService();
	private final ConglomeradoService conglomeradoService = new ConglomeradoService();
	private final HogarService hogarService = new HogarService();
	private final ViviendaMarcoService viviendaMarcoService = new ViviendaMarcoService();
	private final OdeiService odeiService = new OdeiService();
	private final PeriodoService periodoService = new PeriodoService();
	private final ViviendaService viviendaService = new ViviendaService();
	private final VisitaEncuestadorService visitaEncuestadorService = new VisitaEncuestadorService();
	private final EncuestadorService encuestadorService = new EncuestadorService();
	private final PersonalService personalService = new PersonalService();
	private final DepartamentoService departamentoService = new DepartamentoService();
	private final ProvinciaService provinciaService = new ProvinciaService();
	private final DistritoService distritoService = new DistritoService();
	
	private final Ena01OtrosHogarService ena01OtrosHogarService = new Ena01OtrosHogarService();
	private final Ena01Cap100Service ena01Cap100Service = new Ena01Cap100Service();
	private final Ena01Cap100AService ena01Cap100AService = new Ena01Cap100AService();
	private final Ena01ObservacionesService ena01ObservacionesService = new Ena01ObservacionesService();
	private final MiembroHogarEna01Cap200Service ena01Cap200Service = new MiembroHogarEna01Cap200Service();
	private final PersonaPanelService personaPanelService = new PersonaPanelService();
	private final VisitaSupervisorService visitaSupervisorService = new VisitaSupervisorService();
	
	public void inicializar() {
		openHelper = new EnahoOpenHelper(Aplicacion.getAplicacion());
		
		dataXmlMarcoService.setOpenHelper(openHelper);
		
		conglomeradoService.setOpenHelper(openHelper);
		
		hogarService.setOpenHelper(openHelper);
		hogarService.setViviendaService(viviendaService);
		hogarService.setEna01Cap100Service(ena01Cap100Service);
		
		viviendaMarcoService.setOpenHelper(openHelper);
		
		odeiService.setOpenHelper(openHelper);
		
		viviendaService.setOpenHelper(openHelper);
		viviendaService.setViviendaMarcoService(viviendaMarcoService);
		
		visitaEncuestadorService.setOpenHelper(openHelper);
		
		encuestadorService.setOpenHelper(openHelper);
		encuestadorService.setPersonalService(personalService);
		
		personalService.setOpenHelper(openHelper);
		
		departamentoService.setOpenHelper(openHelper);
		provinciaService.setOpenHelper(openHelper);
		distritoService.setOpenHelper(openHelper);
		
		ena01OtrosHogarService.setOpenHelper(getOpenHelper());
		
		ena01Cap100Service.setOpenHelper(getOpenHelper());
		
		ena01Cap100AService.setOpenHelper(getOpenHelper());
		
		ena01ObservacionesService.setOpenHelper(getOpenHelper());
		
		ena01Cap200Service.setOpenHelper(getOpenHelper());
		
		personaPanelService.setOpenHelper(getOpenHelper());
		
		visitaSupervisorService.setOpenHelper(getOpenHelper());
		//visitaSupervisorService.setVisitaEncuestadorService(visitaEncuestadorService);
	}
			
	public Ena01Cap100AService getEna01Cap100AService() {
		return ena01Cap100AService;
	}

	public EnahoOpenHelper getOpenHelper() {
		return openHelper;
	}

	protected void setOpenHelper(EnahoOpenHelper openHelper) {
		this.openHelper = openHelper;
	}

	public DataXmlMarcoService getDataXmlMarcoService() {
		return dataXmlMarcoService;
	}
	public ConglomeradoService getConglomeradoService() {
		return conglomeradoService;
	}

	public HogarService getHogarService() {
		return hogarService;
	}

	public ViviendaMarcoService getViviendaMarcoService() {
		return viviendaMarcoService;
	}

	public OdeiService getOdeiService() {
		return odeiService;
	}

	public PeriodoService getPeriodoService() {
		return periodoService;
	}	
	
	public ViviendaService getViviendaService() {
		return viviendaService;
	}

	public VisitaEncuestadorService getVisitaEncuestadorService() {
		return visitaEncuestadorService;
	}

	public EncuestadorService getEncuestadorService() {
		return encuestadorService;
	}

	public PersonalService getPersonalService() {
		return personalService;
	}

	public DepartamentoService getDepartamentoService() {
		return departamentoService;
	}

	public ProvinciaService getProvinciaService() {
		return provinciaService;
	}

	public DistritoService getDistritoService() {
		return distritoService;
	}

	public Ena01OtrosHogarService getEna01OtrosHogarService() {
		return ena01OtrosHogarService;
	}

	public Ena01Cap100Service getEna01Cap100Service() {
		return ena01Cap100Service;
	}

	public Ena01ObservacionesService getEna01ObservacionesService() {
		return ena01ObservacionesService;
	}

	public MiembroHogarEna01Cap200Service getMiembroHogarEna01Cap200Service() {
		return ena01Cap200Service;
	}

	public MiembroHogarEna01Cap200Service getEna01Cap200Service() {
		return ena01Cap200Service;
	}

	public PersonaPanelService getPersonaPanelService() {
		return personaPanelService;
	}

	public VisitaSupervisorService getVisitaSupervisorService() {
		return visitaSupervisorService;
	}
	
	
}
